#! /bin/bash
echo "+%Y-%m-%d %H:%M:%S"
echo "Start"
#判断宝塔WebHook参数是否存在
if [ ! -n "$1" ];
then 
   echo "param参数错误"
   echo "End"
   exit
fi


#git项目路径
# gitPath="/home/python/$1"
gitPath="/mnt/api/$1"
#git 网址
#gitHttp="git@github.com:bxgh/$1.git"
gitHttp="git@gitee.com:wwsa518/$1.git"

echo "Web站点路径:$gitPath"
echo "Web站点路径:$gitHttp"


cd $gitPath
echo "cd $gitPath"
git clone $gitHttp gittemp
echo "gitclone..."
cp -rf  gittemp/.git .
rm -rf gittemp
git reset --hard origin/master
git pull
echo "pull finished"
#chown -R www:www $gitPath
docker restart fastapi_server
exit
